home *** CD-ROM | disk | FTP | other *** search
- Path: mn5.swip.net!news
- From: tomas.jansson@mbox201.swipnet.se (Tomas Jansson)
- Newsgroups: comp.lang.c++
- Subject: Re: dynamic arrays using char with far pointers
- Date: 29 Mar 1996 15:06:59 GMT
- Organization: -
- Message-ID: <4jguaj$oq0@mn5.swip.net>
- References: <4jcg4l$18hq@news.missouri.edu>
- NNTP-Posting-Host: dialup115-2-2.swipnet.se
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- NNTP-Posting-User: cda9f056754bf9b500041a0d5a9124a7
- X-Newsreader: WinVN 0.99.6
-
- On Mar 26, 1996 Chris Vogel(c576537@mizzou1.missouri.edu) wrote:
-
- >
- >I'm converting some code I have out of a book to C++. I'm converting a
- >structure to a class(kind of logical :) ). The structure has:
- >
- > char far *buffer;
- >
- >Now, I thought that to initialize it, it would be:
- >
- > buffer = new char[size];
- >
- >but that gives me a run time error. So, I changed it to:
- >
- > buffer = new (char far *)[size];
- >
-
- If you want to make a far pointer to your dynamic memory you must write
-
- buffer = (char far *)new char[size];
-
-
- /Tomas Jansson
-
-